/**
 * 二维码页
 */
var React = require("react");
var {Grid,Row,Col} = require("react-bootstrap");
var {Util} = require("flower");
class Qrcode extends React.Component{
    constructor(props){
        super(props);
        this.state = {

        };
    }

    ascii2str(arr){
        var str = "";
        for(var i=0;i<arr.length;i++){
            var s = String.fromCharCode(arr[i]);
            str += s;
        }
        return str;
    }

    componentDidMount(){

        $("#qrcode").css({
            width:$(window).width(),
            height:$(window).height(),
            marginLeft:$(window).width()/2-100,
            marginTop:$(window).height()/2-100
        });
        var qrcode = new QRCode('qrcode', {
            text: this.ascii2str(window.BASE64.decoder(mei.qrurl)),
            width: 200,
            height: 200,
            colorDark: '#000000',
            colorLight: '#ffffff',
            correctLevel: QRCode.CorrectLevel.H
        });
    }

    render() {
        return (
            <div id="qrcode">
            </div>
        );
    }
}
module.exports = Qrcode;